#pragma once

#include "QtGuiBuilder.h"

class MyDialog : public QDialog
{
    Q_OBJECT

private:
    QToolBar* toolbar;
    QGroupBox* groupMain;
    QGroupBox* groupButtons;
    QDialogButtonBox* buttons;
    QLineEdit* editFileOpen;
    QLineEdit* editFileSave;
    QLineEdit* editItemName;
    QComboBox* cboItemType;
    QPushButton* buttonReadPos1;
    QPushButton* buttonReadPos2;
    QPushButton* buttonReadPos3;
    QPushButton* buttonReadPos4;
    QDoubleSpinBox* editNominalValue;
    QDoubleSpinBox* editUpperDeviation;
    QDoubleSpinBox* editLowerDeviation;

    QTableWidget* table;
    QMargins marginDialog = QMargins(8, 8, 8, 8);
    QMargins marginGroup = QMargins(8, 16, 8, 8);
    int mainPaneRows = 22;

public:
    MyDialog(QWidget* parent);

private slots:

    void onAdd();

    void onRejected();

private:
    void fillTable();

    void setupUi();

    void setUpToolbar();

    void setUpMainPane();

    void setupButtonPane();

    void loadData();
};
